<template>
  <div class="contain">
    <div class="header-box">
      <img src="../../assets/images2/logo.svg" class="header-logo" alt="" />
    </div>
    <div class="content">
      <div class="t-title">
        Ai Stock Diagnosis with 8820 Instances and 98% Success Rate – Help You
        Easily Make Big Money!
      </div>
      <PlayerCom class="viedeo-sty" :url="Url"></PlayerCom>
      <!-- <div class="img">
        <img src="../../assets/images2/1.jpg" class="pre-img" alt="" />
      </div> -->
      <div class="pre" v-for="(item, index) in preData" :key="index">
        <img :src="item.img" class="pre-img" alt="" />
        <div class="pre-parf">{{ item.pre }}</div>
      </div>
    </div>
    <div class="tempte" ref="tempteRef">
      <div class="t-box">
        <div
          class="t-item"
          v-for="(item, index) in numberData"
          :key="index + 'a'"
        >
          <div class="t-number" :data-set="item.number"></div>
          <div class="t-title">{{ item.title }}</div>
        </div>
      </div>
    </div>
    <div class="footer">
      <div class="f-1 flex-row">
        <img src="../../assets/images2/i1.png" class="f-img" alt="" />
        <img src="../../assets/images2/i2.png" class="f-img" alt="" />
      </div>
      <div class="f-2">
        <img src="../../assets/images2/logo2.svg" class="footer-logo" alt="" />
        <div class="hanxian"></div>
        <div class="f-pre">
          <strong>Bain Capital, LP</strong>
          is one of the world’s leading private investment firms with
          approximately $185 billion of assets under management that creates
          lasting impact for our investors, teams, businesses, and the
          communities in which we live. Since our founding in 1984, we’ve
          applied our insight and experience to organically expand into several
          asset classes including private equity, credit, public equity, venture
          capital and real estate. We leverage our shared platform to capture
          cross-asset class opportunities in strategic areas of focus. With
          offices on four continents, our global team aligns our interests with
          those of our investors for lasting impact.
        </div>
        <div class="f-ul">
          <strong>About Us</strong>
          <strong>Businesses</strong>
          <strong>People</strong>
          <strong>ESG & Impact</strong>
          <strong>Newsroom</strong>
        </div>
        <div class="f-pre">
          © 2012-2024 Bain Capital, LP. The Bain Capital square symbol is a
          trademark of Bain Capital, LP. All Rights Reserved.
        </div>
        <div class="f-ul2">
          <p>Privacy Policy</p>
          <p>Terms of Use</p>
          <p>Regulatory Disclosures</p>
          <p>Web Fraud and Phishing Warning</p>
        </div>
      </div>
    </div>
    <BubbleAnimation
      :dataList="manData"
      :intervalTime="2000"
      :displayTime="2000"
    ></BubbleAnimation>
    <div class="input-box">
      <input
        type="text"
        class="input-sty"
        v-model="gpdm"
        placeholder="Please enter the stock code."
      />
      <van-button color="#fc5531" class="btn" @click="goLink" round type="info"
        >Join the group, get free stock analysis</van-button
      >
    </div>
  </div>
</template>

<script>
import PlayerCom from "@/components/PlayerCom.vue";
import BubbleAnimation from "@/components/BubbleAnimation.vue";
export default {
  name: "PageView",
  components: {
    PlayerCom,
    BubbleAnimation,
  },
  data() {
    return {
      manData: [
        { name: "Sahadeva Upalekar" },
        { name: "Asvalayana Patvardhan" },
        { name: "Yudhishthira Gaur" },
        { name: "Ananda Gazdar" },
        { name: "Panini Sardar" },
        { name: "Amrit Hegadi" },
        { name: "Ramaeshwara Upadhyay" },
        { name: "Arun Patel" },
        { name: "Ashtavakra Parekh" },
        { name: "Vasishtha Haradas" },
        { name: "Navneet Bakshi" },
        { name: "Baibhav Dvivedi" },
        { name: "Harsh Choraghad" },
        { name: "Prashant Phadatare" },
        { name: "Prashant Anagal" },
        { name: "Vikas Sardar" },
        { name: "Cyavana Punja" },
        { name: "Motilal Kumar" },
        { name: "Jayadeva Shevade" },
        { name: "Nakula Sabanis" },
        { name: "Rura Kayal" },
        { name: "Navneet Bandyopadhyay" },
        { name: "Krishan Dongerkerry" },
        { name: "Ragunath Anagal" },
        { name: "Ragoba Vaknis" },
        { name: "Anuraag Mahalanabis" },
        { name: "Rishu Heravdakar" },
        { name: "Anguri Ojha" },
        { name: "Akshey Dheer" },
        { name: "Gagan Malviya" },
        { name: "Din Khamavant" },
      ],
      currentIndex: 0,
      showBubble: false,
      Url: "https://1325620725.vod-qcloud.com/bfbd3e82vodhk1325620725/f0f4de541397757888197999893/iAL1f0HJaYgA.mp4",
      tempteTop: null,
      rollingNumbers: [],
      scrolled: false,
      numberData: [
        { number: 8927, title: "Current diagnosis stocks" },
        { number: 17103778, title: "Current number of participants" },
        { number: 3913266, title: "Quantitative number of transactions" },
        { number: 221012338, title: "total profit" },
      ],
      preData: [
        {
          img: require("../../assets/images2/item77.jpg"),
          subtitle: "Venture",
          pre: "We are proud to introduce the Artificial Intelligence Large-scale Model Stock Diagnosis Service, IntelliTrade AI, providing you with the most professional and accurate stock investment advice. Our model, developed over 2 years, encompasses 5 billion stock trading parameters and utilizes thousands of trading indicators. It has already helped over 170,000 individuals earn $220 million.",
        },
        {
          img: require("../../assets/images2/item4.jpg"),
          subtitle: "Venture",
          pre: "IntelliTrade AI's large-scale model matches billions of parameters for each indicator and undergoes over 1.5 years of learning and optimization, resulting in a comprehensive set of hybrid indicator-based quantitative trading strategies. It not only helps you diagnose stock trends but also offers automated quantitative trading services, making it easy for you to make big money.",
        },
        {
          img: require("../../assets/images2/item5.jpg"),
          subtitle: "Venture",
          pre: "The advantages of the IntelliTrade AI quantitative trading system are remarkable:1. Accurate predictions: Through deep learning, the system can accurately forecast market trends, capture market signals, and make wise investment decisions.2. High-frequency trading: The system's ability to execute 3,913,266 trades demonstrates its capability in high-frequency trading, swiftly seizing market opportunities and enabling efficient trading operations.3. High success rate: With a 98% success rate, the system ensures correct investment decisions in most situations, steadily growing your investment returns.",
        },
        {
          img: require("../../assets/images2/item6.jpg"),
          subtitle: "Venture",
          pre: "Now, you only need to enter the stock code to participate in the free stock diagnosis conducted by the Artificial Intelligence large-scale model. Our team of experts will provide you with one-on-one consultation services, helping you make the most accurate investment decisions.",
        },
        {
          img: require("../../assets/images2/item7.jpg"),
          subtitle: "Venture",
          pre: "Don't miss out on any investment opportunities anymore! Join IntelliTrade AI now and explore limitless possibilities for the future alongside top global investors. Let artificial intelligence guide your path to wealth growth!",
        },
        {
          img: require("../../assets/images2/item8.jpg"),
          subtitle: "Venture",
          pre: "What are you waiting for? Join us now and embark on your journey to financial success!",
        },
      ],
    };
  },
  computed: {
    currentMan() {
      return this.manData[this.currentIndex];
    },
  },
  mounted() {
    this.tempteTop = this.$refs.tempteRef.offsetTop;
    console.log("this.tempteTop", this.tempteTop);
    window.addEventListener("scroll", this.handleScroll);
  },
  beforeDestroy() {
    window.removeEventListener("scroll", this.handleScroll);
  },
  methods: {
    goLink() {
      window.location.href = "https://chat.whatsapp.com/Fhi5veeyVnaFcknhneNFBp";
    },
    handleScroll() {
      if (!this.scrolled) {
        const scrollTop =
          window.pageYOffset || document.documentElement.scrollTop;
        // console.log("scrollTop", scrollTop);
        // console.log("tempteTop", this.tempteTop);
        if (scrollTop >= this.tempteTop) {
          this.startFn();
        }
      }
    },
    startFn() {
      let counters = document.querySelectorAll(".t-number"); //获取到三个counter盒子
      counters.forEach((item) => {
        item.innerText = "0"; //记录分数变化的变量，初始值为0
        const updateData = () => {
          const data = +item.getAttribute("data-set"); //获取到元素中绑定的数据
          const tmp = +item.innerText; //临时变量保存变化一次的数据量
          const changeData = data / 1000; //设置改变的速率
          if (tmp < data) {
            //如果临时变量的值小于最终数据的值，那么就给元素进行数据相加
            item.innerText = `${Math.ceil(tmp + changeData)}`; //值数相加，然后进行取整
            setTimeout(updateData, 1); //定时器传入回调函数目的在于动态变化
          } else {
            item.innerText = data; //不满足条件后，证明得到了最终数据，直接渲染
          }
        };
        this.scrolled = true;
        // 移除滚动事件监听器，以确保方法只被调用一次
        window.removeEventListener("scroll", this.handleScroll);
        updateData(); //调用函数，启动函数
      });
    },
  },
};
</script>

<style lang="less" scoped>
.contain {
  width: 100%;
  background-color: white;
  min-height: 100vh;
}
.header-box {
  width: 100%;
  height: 250px;
  background-image: url(../../assets/images2/item2.png);
  background-size: 100% 250px;
  padding: 15px 30px;
  box-sizing: border-box;
  .header-logo {
    width: 180px;
    height: 30px;
  }
}
.tempte {
  padding: 30px 15px;
  box-sizing: border-box;
  background-color: #f7f5f4;
}
.t-box {
  width: 100%;
  background-color: #1c2156;
  border-radius: 15px;
  display: flex;
  color: #fff;
  flex-direction: column;
  justify-content: space-between;
}
.t-item {
  width: 100%;
  height: 90px;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  .t-number {
    font-size: 30px;
    line-height: 30px;
  }
  .t-title {
    font-size: 14px;
    margin-top: 5px;
    line-height: 27px;
    color: #fff;
  }
}
.content {
  padding: 0 30px;
  box-sizing: border-box;
}
.t-title {
  font-size: 28px;
  color: #000000;
}
.pre-img {
  width: 100%;
  border-radius: 10px;
  margin: 20px 0;
}
.pre {
  color: #71716f !important;
  font-size: 16px;
  line-height: 1.42857143;
  margin-top: 30px;
}
.sub-title {
  font-weight: 700;
  font-size: 20px !important;
}
.flex-row {
  display: flex;
  flex-direction: row;
}
.footer {
  padding: 30px 30px;
  box-sizing: border-box;
  background-color: #fff;
}
.f-1 {
  width: 70px;
  justify-content: space-between;
}
.footer-logo {
  width: 221px;
  height: 37px;
  margin: 20px 0;
}
.hanxian {
  width: 100%;
  height: 2px;
  background-color: #1c2156;
}
.f-img {
  width: 30px;
  height: 30px;
}
.f-pre {
  color: #212355;
  font-size: 15px;
  line-height: 22px;
  margin: 20px 0;
}
.f-ul {
  display: flex;
  color: #212355;
  font-size: 15px;
  flex-direction: column;
}
.f-ul strong {
  margin-bottom: 10px;
}
.f-ul2 {
  display: flex;
  color: #212355;
  font-size: 15px;
  text-decoration: underline;
  flex-wrap: wrap;
}
.f-ul2 p {
  margin: 3px 0;
  padding-right: 20px;
}
.viedeo-sty {
  margin: 20px 0;
}
.input-box {
  width: 100%;
  position: fixed;
  bottom: 0;
  height: 160px;
  padding: 0 20px;
  box-sizing: border-box;
  .input-sty {
    border-radius: 25px;
    width: 100%;
    height: 40px;
    border: none;
    border: #fc5531 solid 1px;
    background-color: #fff;
    /* 重置默认的背景颜色 */
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    /* 取消默认的内边距 */
    padding: 0;
    /* 取消默认的外边距 */
    margin: 0;
    /* 去除默认的外边框 */
    outline: none;
    text-indent: 0.5rem;
    font-size: 16px !important;
  }
  .input-sty::placeholder {
    font-size: 16px !important;
    color: #999; /* 设置为灰色 */
  }
}
.btn {
  margin-top: 10px;
  width: 100%;
}
</style>
